package com.grsu.phonestation.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "INVOICE")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Invoice {

	@Id
	@GeneratedValue
	@Column(name = "ID")
	private int id;

	@Column(name = "DATEACTIVATION")
	private Date dateActivation;

	@Column(name = "SUM")
	private double sum;

	@ManyToOne
	@JoinColumn(name = "USERID", insertable = true, updatable = true, nullable = true)
	private User user;

	@ManyToOne
	@JoinColumn(name = "TYPEPAYMENTID", insertable = true, updatable = true, nullable = true)
	private TypePayment typePayment;

	@Column(name = "ISREPLAY")
	private boolean isReplay;

	public TypePayment getTypePayment() {
		return typePayment;
	}

	public void setTypePayment(TypePayment typePayment) {
		this.typePayment = typePayment;
	}

	public int getId() {
		return id;
	}

	public boolean getIsReplay() {
		return isReplay;
	}

	public void setIsReplay(boolean isReplay) {
		this.isReplay = isReplay;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getDateActivation() {
		return dateActivation;
	}

	public void setDateActivation(Date dateActivation) {
		this.dateActivation = dateActivation;
	}

	public double getSum() {
		return sum;
	}

	public void setSum(double sum) {
		this.sum = sum;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
